<template>
	<view>
			<!-- 评论输入框 -->
			<view class="input-box u-f-ac u-f-jsa">
			   <input type="text" confirm-type="发送" v-model="val" :placeholder="placeholder" @confirm="send" :focus="commit"  @blur="blur" @keyboardheightchange="keyboardheightchange" />
			   <view class="view-btn">
				  <button type="primary" @tap="send">发送</button>
			   </view>
		   </view>

	</view>
</template>

<script>
	export default{
		data() {
			return {
				val: ''
			}
		},
		props:['commit','placeholder'],
		methods:{
			send(){
				console.log('我被点击了')
				this.$emit("submit",this.val)
				this.val = '';
			},
			onTap(){
				
			},
			blur(){
				this.$emit("submitBlur")
			},
			keyboardheightchange(e){
				console.log('键盘高度',e)
			}
		}
	}
</script>


<style lang="scss" scoped>
	.input-box{
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		height: 108rpx;
		box-sizing: border-box;
		padding: 20rpx;
		border-top: 1px solid rgba(204,204,204,.4);
		background-color: #fff;
		input{
			// border-radius: 30rpx;
			border: 1px solid #EEEEEE;
			background: #EEEEEE;
			padding-left: 20rpx;
			padding-top: 10rpx;
			padding-bottom: 10rpx;
			flex: 1;
			margin-right:20rpx;
		}
		.view-btn{
			width: 80px;
		}
		button{
			background-color:#008FD7;
			font-size: 14px;
		}
	}
</style>
